<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="showDOM">输出上方DOM元素</button>
     <school></school>
  </div>
</template>

<script>
//   引入组件
import School from './components/School'
export default {
    name: 'App',
    components: {
        School
    },
    data() {
      return {
        msg: '乘风破浪会有时'
      }
    },
    methods: {
      showDOM(){
        console.log(this.$refs.title)  // <h1>乘风破浪会有时</h1>
      }
    },
}
</script>

<style>

</style>